#include <stdio.h>
#include <limits.h>

int main() {
    int count = 0;
    int max = INT_MIN;
    int min = INT_MAX;
    int temp;
    int sum = 0;
    int i;
    scanf("%d",&count);
    for (i = 0; i < count; i++) {
        scanf("%d",&temp);
        if (temp > max) {
            max = temp;
        } else if (temp < min) {
            min = temp;
        }
        sum += temp;
    }
    sum -= max;
    sum -= min;
    printf("max = %d\nmin = %d\nave = %.6f",max,min,sum/(double)(count-2));
    return 0;
}